<HTML><HEAD><TITLE>graph_get_incoming_edges(+Graph, +TargetNode, -EdgeList)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(graph_algorithms)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>graph_get_incoming_edges(+Graph, +TargetNode, -EdgeList)</H1>
Returns a sorted list of all edges ending in TargetNode
<DL>
<DT><EM>Graph</EM></DT>
<DD>a graph structure
</DD>
<DT><EM>TargetNode</EM></DT>
<DD>an integer node number
</DD>
<DT><EM>EdgeList</EM></DT>
<DD>a list of e/3 edge structures
</DD>
</DL>
<H2>Description</H2>
<P>
    Note on performance: By default, the graph structure only stores the
    outgoing (adjacent) edges of every node.  The incoming edge lists are
    computed lazily when graph_get_incoming_edges/3 is called for the first
    time (but then they are built for all nodes at once).  Therefore the
    first call to this predicate has O(NlogN) complexity, subsequent calls
    are only O(1). It may therefore make sense to do a dummy call to this
    predicate before starting time critical or nondeterministic computation.
    </P>
<H3>Modes and Determinism</H3><UL>
<LI>graph_get_incoming_edges(+, +, -) is det
</UL>
<H2>See Also</H2>
<A HREF="../../lib/graph_algorithms/graph_get_all_edges-2.html">graph_get_all_edges / 2</A>, <A HREF="../../lib/graph_algorithms/graph_get_adjacent_edges-3.html">graph_get_adjacent_edges / 3</A>
</BODY></HTML>
